<div class="container">
  <h1>parse_datetime()</h1>
  <p class="signature"> function parse_datetime(string $datetime_str): \DateTime|false </p>
  <h2>Description</h2>
  <div class="description">
    <p>Parses a datetime string into a date object or returns false.</p>
  </div>
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
        <th>Default</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>$datetime_str</td>
        <td>string</td>
        <td>The datetime string to parse (format: "mm/dd/yyyy HH:MM" or "mm-dd-yyyy HH:MM").</td>
        <td>N/A</td>
      </tr>
    </tbody>
  </table>
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>\DateTime|false</td>
        <td>Returns a \DateTime object representing the parsed datetime if successful, otherwise returns false if invalid.</td>
      </tr>
    </tbody>
  </table>
  <h2>Example Usage</h2>
  <div class="example">
    <pre>
$result = parse_datetime("12/25/2023 08:30");
if ($result !== false) {
    echo $result->format('Y-m-d H:i:s');
} else {
    echo "Invalid datetime string.";
}
// Output: 2023-12-25 08:30:00</pre>
  </div>
</div>
